<?php

/**
 *  @FileComment            [订单订单列表评论视图模型]
 *  @ProjectName             项目名称：JDshop
 *  @FileName                   文件名称：OrderOrderListCommentViewModel.class.php
 *  @Author                       yuerengui <596580041@qq.com>
 *  @Date                          2014-10-22 17:36:48
 *  *
 */
class OrderOrderListCommentViewModel extends ViewModel {

        public $table = 'orderinfo';
        public $view = array(
            'orderinfo' => array('_type' => 'INNER'),
            'order_list' => array('_type' => 'INNER', '_on' => '__orderinfo__.oid=order_list.order_oid'),
            'comment' => array('_type' => 'INNER', '_on' => '__order_list__.olid=comment.order_list_olid')
        );

        public function get_count_data($uid) {
                return $this->where('user_uid=' . $uid . ' and orderstatu="已完成"')->getField('olid', true);
        }

        public function get_data($where = NULL) {
                return $this->where($where)->all();
        }

}
